#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
#define MaxSize 100
typedef char ElemType;
typedef struct
{
	ElemType data[MaxSize];
	int top;
}SqStack;
void InitStack(SqStack* stack)
{
	stack->top = 0;
}
int PushStack(SqStack* stack, char a)
{
	if (stack->top == MaxSize)
	{
		printf("NUMBER FULL!");
		return 0;
	}
	else
	{

		stack->data[stack->top] = a;
		stack->top++;
	}
	return 0;
}
void ShowStack(SqStack* stack)
{
	if (stack->top == 0)
	{
		printf("EMPTY!");
		return;
	}
	else
	{
		int p;
		p = stack->top;
		while (p != 0)
		{
			p--;
			printf("%c", stack->data[p]);
		}
	}
}
int PaStack(SqStack* stack,char* s)
{
	if (stack->top == 0)
	{
		printf("EMPTY!");
		return;
	}
	else
	{
		int p;
		int i=0;
		p = stack->top;
		while (p != 0)
		{
			p--;
			if (s[i++] != stack->data[p])
			{
				return -1;
			}
		}
		return 1;
	}
}
int main()
{
	int b,i;
	char a;
	char c[MaxSize];
	SqStack s;
	InitStack(&s);
	printf("num:");
	scanf("%d",&b);
	getchar();
	printf("push...\n");
	for(i=0;i<b;i++)
	{
		scanf("%c", &a);
		c[i] = a;
	    PushStack(&s,a);
	}
	printf("show:\n");
	ShowStack(&s);
	int j;
	j = PaStack(&s, c);
	if (j == -1)
	{
		printf("\nNO!");
	}
	else if (j == 1)
	{
		printf("\nYES!");
	}
	return 0;
}